using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.ObjectModel;
using NTTHAO.Web.Rss;
using NTTHAO.Common;
using System.Globalization;

public partial class admin_webparts_Plug_ins_RssNews_RssContentTest : System.Web.UI.UserControl
{
    public RssDocument _RssDoc = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string url =
                //"http://tuoitre.vn/RssFeeds.aspx?ChannelID=3";
                //"http://kenh14.vn/home.rss";
                "http://phunutoday.vn/index.rss";

            string rssContent = WebClientUtilities.ReadContent(url, System.Text.Encoding.UTF8);

            //HtmlGenericControl ctrl = new HtmlGenericControl("div");
            //ctrl.InnerHtml = Server.HtmlEncode(rssContent);
            //this.Controls.Add(ctrl);

            //_RssDoc = new RssDocument(rssContent, CultureInfo.CreateSpecificCulture("vi"));
            _RssDoc = new RssDocument(rssContent);
        }
        catch (Exception ex)
        {
            HtmlGenericControl ctrl = new HtmlGenericControl("div");
            ctrl.InnerHtml = "<p>" + ex.Message + "</p><p>" + ex.StackTrace + "</p>";
            this.Controls.Add(ctrl);
        }
    }
}